<ui:composition template="WEB-INF/templates/template.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:define name="breadCrumb">
        <p:menuitem value="Home" action="showMessages" ajax="false"/>
        <p:menuitem value="Home" helpText="Hallo" action="showMessages" ajax="false"/>
        <p:menuitem value="Users you follow" action="showUsersYouFollow" ajax="false"/>
    </ui:define>

    <ui:define name="content">
        <div class="yui3-u-1 ui-widget ui-widget-content ui-corner-all">
            <h:form>
                <p:panel styleClass="yui3-u-1 contentPanel">
                    <f:facet name="footer">
                        <div style="text-align: right;">
                            <p:commandButton value="Unfollow" actionListener="#{usersBean.unfollow}" ajax="false">
                            </p:commandButton>
                        </div>
                    </f:facet>

                    <p:dataTable id="tblUsers"
                                 value="#{usersBean.users}"
                                 var="item"
                                 paginator="true"
                                 rows="5"
                                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                 rowsPerPageTemplate="5,10,25,50"
                                 selection="#{usersBean.selectedUser}"
                                 selectionMode="single">
                        <p:column>
                            <f:facet name="header">
                                <h:outputLabel value="#{msgs['user.username.label']}"/>
                            </f:facet>
                            <h:outputText value="#{item.username}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputLabel value="#{msgs['user.post.count.label']}"/>
                            </f:facet>
                            <h:outputText value="#{item.messageCount}"/>
                        </p:column>
                    </p:dataTable>
                </p:panel>
                <div class="yui3-u-1 btnPanel textCenter">
                    <p:commandButton value="#{msgs['default.button.search.label']}" action="searchUsers" ajax="false" />
                </div>
            </h:form>
        </div>
    </ui:define>
</ui:composition>